<template>
  <div class="message">
    <img :src="msg.img" alt="" :class="order" />
    <p>{{ msg.msg }}</p>
  </div>
</template>

<script>
export default {
  props: ['msg', 'order'],
  mounted() {
    console.log(this.order)
  },
}
</script>

<style lang="scss" scoped>
.message {
  min-width: 50px;
  max-width: 200px;
  display: flex;
  img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
  }
  p {
    flex: 1;
    box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.2);
    min-height: 40px;
    word-break: break-word;
  }
  .order0 {
    order: 0;
  }
  .order1 {
    order: 1;
  }
}
</style>
